home *** CD-ROM | disk | FTP | other *** search
- Path: news.tau.ac.il!usenet
- From: "Avi L." <avil@sapiens.com>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Dynamic loading/linking
- Date: Tue, 02 Apr 1996 13:25:01 +0200
- Organization: Sapiens Tech.
- Message-ID: <31610E8D.23C6@sapiens.com>
- References: <Dp0x52.90C.0.-s@cs.vu.nl>
- NNTP-Posting-Host: honda.sapiens.co.il
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (WinNT; I)
-
- Irmen de Jong wrote:
-
- > What solutions are feasible?
- >
- > - Overlay. Don't know how this works. Can overlays reference global
- > data? YES.
-
- Can overlays be loaded without replacing other parts of the
- > program? YES, as long as the overlay module is separate from the main program.
-
- Can overlays be constructed without a great deal of work
- > required by the programmer (yea, that's right, me)?
-
- NO, they have a few restrictions which can make life diffilcult for ya and you still
- can't reference global data. see answer 2.
-
- > - Amiga shared library. Would be most ideal, but libraries cannot reference
- > global data. (Ok Ok they can by passing all the pointers to all the
- > global data you want to reference but in my case this is no option.
- > Way to much global data.)
-
- yes, it's a sore point about the amiga OS. no dynamic linking is indeed a problem but
- you can pack the globals into a structure and pass that structure's address to the library.
- you'll have to create macros with the names of the of your globals that access the structure
- instead of the stand-alone variables. that way you'll save yourself alot of compilation pain.
- it does require a little work but i would recommend it
- since you don't have any other choice, unless you wanna stick with one
- large program.
-
- > - Dynamic loading with LoadSeg(). Can't reference global data, can I?
-
- No you can't unless you wanna use addresses instead of variable names.
- i don't think you wanna do that though, so it's out of the question.
- best way (and the only one for now) is to use method 2 (ie libraries).
-
- > *sigh* I thought it wasn't necessary but now I think the Amiga should have
- > some sort of dynamic linking support. AmigaDOS 4.0?
-
- it isn't necessary since 'dynamic linking' exists for the functions and method 2
- can easily be used to circumvent any problems regarding globals.
-
- Avi Lev.
-